package com.example.invoke.util;

public enum RespEnum {

    getA("业务处理失败", "503"),

    ERROR("error", "503");

    private String msg;

    private String code;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    RespEnum(String msg, String code) {
        this.msg = msg;
        this.code = code;
    }

    public static RespEnum getEnum (String name) {
        try {
            return RespEnum.valueOf(name);
        } catch (IllegalArgumentException exception) {
            exception.printStackTrace();
        }
        return ERROR;
    }
}
